export default {
    name: "app",
    data() {
        return {
            // 仓库信息
            warehouse_detail: {},

            // 表头
            tableColumnList: [],
            // 表格数据
            showList: [],
            // 分页
            currentPage: 1,
            total: 0,
            pageSize: 7,
        }
    },
    created() {
        // console.log(this.$route.query.detail)
        this.warehouse_detail = this.$qs.parse(this.$route.query.detail)
        this.search_warehouse_detail()
    },
    methods: {
        // 根据仓库id获取仓库库存列表信息
        async search_warehouse_detail() {
            const { data: res } = await this.$http.post('/gim/api/admin/manageInventory/selectInventory/' + this.warehouse_detail.warehouseId);
            // console.log(res)
            if (res.code == 1) {
                this.total = res.response.totalNum
                this.tableColumnList = res.response.tableColumnList
                this.showList = res.response.inventoryItemVM
            }
            else {
                this.$store.commit('error', res.response)
            }
        },

        /* 对表格的操作 */
        //对el-table的表头，表格的样式进行设置
        tableHeaderCellStyle() {
            return 'background-color: #2c9678; color: #ffffff; border-color: white;'
        },
        tableCellStyle() {
            return 'border-color: #2c9678;'
        },
        // 页数变化
        handleCurrentChange(val) {
            this.currentPage = val;
        },
    },
}